package com.indexingsystem.boss.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.indexingsystem.boss.Vo.ResCategoryOrderQueryVo;
import com.indexingsystem.boss.Vo.TreeQueryVo;
import com.indexingsystem.boss.entity.MenusRelations;
import com.indexingsystem.boss.entity.PavilionColumns;

@Repository
public interface PavilionColumnsMapper {
	
	PavilionColumns getPavilionColumnName(String name);
	
	int getPavilionColumnsList(TreeQueryVo treeQueryVo);
	
	List<PavilionColumns> selectPavilionColumnsList(TreeQueryVo treeQueryVo);
	
	List<MenusRelations> seleteMenusRelations(String id);
	
	PavilionColumns selectPavilionColumns(String id);
	
	int updatePavilionColumns(PavilionColumns pavilionColumns);
	
	int insertMenusRelations(@Param("list") List<MenusRelations> list);
	
	int insertPavilionColumns(PavilionColumns pavilionColumns);
	
	int deleteMenusRelations(@Param("list") List<String> list);
	
	int deletePavilionMenuRelations(@Param("list") List<String> list);
	
	int deletePavilionColumns(@Param("list") List<String> list);
	
	String getParentMenuSortMax(String id);
	
	PavilionColumns selectByPrimaryKey(String id);
	
	List<PavilionColumns> getPavilionColumns();
	
    /**
     * 栏目菜单排序获取自身或目录排序栏目菜单列表.
     * 
     * @param resCategoryOrderQueryVo
     * @return
     */ 
    List<PavilionColumns> getPavilionColumnsByColumnOrder(ResCategoryOrderQueryVo resCategoryOrderQueryVo);
    
    /**
     * 批量修改菜单栏目上移、下移操作.
     * @param list
     * @return
     * @throws Exception
     */
    int updateBatchPavilionColumns(@Param("list") List<PavilionColumns> list);
    
    
    /**
     * 获取父级最小排序值.
     * @param id
     * @return
     */
    String getParentMenuSortMin(String id);
    
    
    /**
     * 通过资源分类id批量删除栏目资源分类关系表.
     * @param list
     * @return
     */
    int deleteMenusRelationsByResCategoryIds(@Param("list") List<String> list);
}